package com.goddess.yeecolor.activity.myFragmentItemActivityAll;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.widget.ImageView;

import com.goddess.yeecolor.R;
import com.goddess.yeecolor.adapter.ExerciseFragmentPagerAdapter;
import com.goddess.yeecolor.base.BaseActivity;
import com.goddess.yeecolor.fragment.MyCollectionFragments.ActivityFragment;
import com.goddess.yeecolor.fragment.MyCollectionFragments.VideoFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * 作者: CaoJunping
 * 时间: 2017/1/16
 * 作用: ******
 * 备注: 我的Fragment个人收藏页面
 */
public class MyCollectionActivity extends BaseActivity {
    @InjectView(R.id.title_back)
    ImageView titleBack;
    private TabLayout tabLayout;
    private ViewPager viewPager;
    private ExerciseFragmentPagerAdapter adapter;

    private List<String> titles;
    private List<Fragment> fragments;
    private ActivityFragment activityFragment;
    private VideoFragment videoFragment;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        setTheme(R.style.AppTheme);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mycollection);
        ButterKnife.inject(this);


        tabLayout = (TabLayout) findViewById(R.id.mycollection_tablayout);
        viewPager = (ViewPager) findViewById(R.id.mycollection_viewpager);


        fragments = new ArrayList<>();
        activityFragment = new ActivityFragment();
        videoFragment = new VideoFragment();
        fragments.add(activityFragment);
        fragments.add(videoFragment);

        titles = new ArrayList<>();
        titles.add("活动");
        titles.add("视频");

        tabLayout.setTabMode(TabLayout.MODE_FIXED);
        adapter = new ExerciseFragmentPagerAdapter(MyCollectionActivity.this.getSupportFragmentManager(), fragments, titles);
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
    }

    @Override
    public void initOnClck() {

    }

    @Override
    public void initFindView() {

    }

    @Override
    public void initData() {

    }

    @OnClick(R.id.title_back)
    public void onClick() {
        finish();
    }
}
